import { FINISH_STATUS } from '@/enum/common';
import { TASK_LIST } from '@/enum/study-match';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';

/**
 * 用户匹配需求表
 */
@Entity('integral_task')
export class IntegralTask extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'match_id',
    comment: '已匹配组合的id',
  })
  matchId: number;

  @Column({
    type: 'int',
    name: 'task_type',
    comment: '任务类型',
  })
  taskType: TASK_LIST;

  @Column({
    type: 'int',
    name: 'schedule',
    comment: '当前进度（0-10）',
    default: 10,
  })
  schedule: number;

  @Column({
    type: 'int',
    name: 'integral',
    comment: '存入积分',
  })
  integral: number;

  @Column({
    type: 'int',
    name: 'status',
    comment: '完成状态',
    default: FINISH_STATUS.NOT_FINISHED,
  })
  status: FINISH_STATUS;
}
